FROM centos:latest
RUN mkdir -p /app
RUN mkdir -p  /app/mongodb/conf
RUN mkdir -p  /app/mongodb/data
RUN mkdir -p  /app/mongodb/log/
RUN touch /app/mongodb/log/mongo.log
RUN yum install wget -y
RUN wget https://file-1251292055.cos.ap-chongqing.myqcloud.com/mongodb-linux-x86_64-rhel70-4.0.1.tgz
RUN tar -zxvf mongodb-linux-*-4.0.1.tgz
RUN mv mongodb-linux-x86_64-rhel70-4.0.1/*  /app/mongodb
COPY mongodb.yml /app/mongodb/conf/mongodb.yml
RUN export PATH=/app/mongodb/bin:$PATH
EXPOSE 27017
CMD [ "mongod","-f","/app/mongodb/conf/mongodb.yml"]



